<?php
    require_once '../../common/DBHelper.php';
    // 获取前端传递回来的id
    $id = $_POST['id'];
    // 删除数据
    $res = deleteById('posts',$id);
    $response = ['code' => 0,'msg' => '操作失败'];
    if($res){
        $response['code'] = 1;
        $response['msg'] = '操作成功';
    }
    echo json_encode($response,JSON_UNESCAPED_UNICODE);
?>